package com.kefu.call.vo;

import java.util.Date;
import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.call.model.CdrSetmeal;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2022/07/26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "计费_套餐表")
public class CdrSetmealSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "套餐名称")
    private String name;
    @ApiModelProperty(value = "套餐备注")
    private String remarks;
    @ApiModelProperty(value = "租用单位[月]")
    private String rentalunit;
    @ApiModelProperty(value = "租用租金")
    private String rentalmoney;
    @ApiModelProperty(value = "免费分钟数")
    private String rentalminute;
    @ApiModelProperty(value = "创建时间")
    private Date createtime;
    @ApiModelProperty(value = "规则时间")
    private Integer chargingtime;
    @ApiModelProperty(value = "超规则收费")
    private String localmoneys;
    @ApiModelProperty(value = "本地市话")
    private String localmoney;
    @ApiModelProperty(value = "国内长途")
    private String domesticmoney;
    @ApiModelProperty(value = "国际长途")
    private String internationmoney;

	 @Override
    public  LambdaQueryWrapper<CdrSetmeal> lambdaQuery(){
    	LambdaQueryWrapper<CdrSetmeal> wrapper=Wrappers.<CdrSetmeal>lambdaQuery();
	    wrapper.like(StringUtils.isNotBlank(name), CdrSetmeal::getName, name);//套餐名称
	    wrapper.like(StringUtils.isNotBlank(remarks), CdrSetmeal::getRemarks, remarks);//套餐备注
	    wrapper.eq(StringUtils.isNotBlank(rentalunit), CdrSetmeal::getRentalunit, rentalunit);//租用单位[月]
	    wrapper.eq(StringUtils.isNotBlank(rentalmoney), CdrSetmeal::getRentalmoney, rentalmoney);//租用租金
	    wrapper.eq(StringUtils.isNotBlank(rentalminute), CdrSetmeal::getRentalminute, rentalminute);//免费分钟数
		wrapper.eq(createtime!=null, CdrSetmeal::getCreatetime, createtime);//创建时间
		wrapper.eq(chargingtime!=null, CdrSetmeal::getChargingtime, chargingtime);//规则时间
	    wrapper.eq(StringUtils.isNotBlank(localmoneys), CdrSetmeal::getLocalmoneys, localmoneys);//超规则收费
	    wrapper.eq(StringUtils.isNotBlank(localmoney), CdrSetmeal::getLocalmoney, localmoney);//本地市话
	    wrapper.eq(StringUtils.isNotBlank(domesticmoney), CdrSetmeal::getDomesticmoney, domesticmoney);//国内长途
	    wrapper.eq(StringUtils.isNotBlank(internationmoney), CdrSetmeal::getInternationmoney, internationmoney);//国际长途
	    
    	return wrapper;
	}
}